<template>
	<view class="box" :style="{'padding-top':systemHeight+29+'px'}">
		<view class="head">
			<image class="back" src="/static/img/back.png" @click="back()"></image>
			<view>My Promotion</view>
			<view class="right" @click="detail" v-if="type!=2">Details</view>
			<view class="right" v-else></view>
		</view>
		<view class="box_top">
			<image class="bg" src="/static/img/bg_1.png"></image>
			<view class="box_top_title">Balance</view>
			<view class="box_top_bigtitle"><text>MK</text>690</view>
			<view class="box_top_smalltitle" v-if="type==2">deposit:MK6000</view>
			<view class="box_top_smalltitle" v-else></view>
			<view class="drawal" @click="detail">Withdrawal</view>
			<view class="box_top_bottom">
				<view class="small_box">
					<view>MK<text>690</text></view>
					<view>Obtained yesterday</view>
				</view>
				<view class="small_box">
					<view>MK<text>690</text></view>
					<view>Accumulated withdrawal</view>
				</view>
			</view>
		</view>
		<view class="content">
			<view class="content_top">
				<view class="" v-if="type==2">Details</view>
				<view class="" v-else>Promotion List</view>
				<view class="" v-if="type!=2">Number:24</view>
			</view>
			<view class="row" v-for="item in 50">
				<image class="avatar" src="/static/img/bg.png"  v-if="type!=2"></image>
				<view class="row_right">
					<view class="nikcname">John Wilson</view>
					<view class="time">2025-04-23</view>
				</view>
				<view class="add_num">+ MK200</view>
			</view>
			<view></view>
		</view>
	</view>
</template>

<script>
	//1是我的推广，2是我的钱包
	export default {
		data() {
			return {
				type:null,
				systemHeight: null
			}
		},
		created() {
			this.systemHeight = uni.getSystemInfoSync().statusBarHeight
		},
		onLoad(e) {
			this.type=e.type
		},
		methods: {
			back() {
				uni.navigateBack()
			},
			rule() {
				uni.navigateTo({
					url: "/pages/promotion/rules"
				})
			},
			detail() {
				uni.navigateTo({
					url: "/pages/promotion/promotionDetails"
				})
			}
		}
	}
</script>

<style>
	.box {
		background: #F8F8F8;
		width: 100%;
		position: fixed;
		height: 100vh;
	}

	.head {
		width: 92%;
		margin: 0rpx auto;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-family: Mont;
		font-weight: bold;
		font-size: 32rpx;
	}

	.back {
		width: 18rpx;
		height: 30rpx;
	}

	.right {
		font-family: Mont;
		font-weight: 500;
		font-size: 28rpx;
	}

	.box_top {
		padding-top: 43rpx;
		padding-bottom: 28rpx;
		margin: 39rpx auto 22rpx;
		position: relative;
		width: 92%;
	}

	.bg {
		z-index: -1;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
	}

	.box_top_title {
		margin: 0rpx 0rpx 10rpx 35rpx;
		font-family: Mont;
		font-weight: 500;
		font-size: 28rpx;
	}

	.box_top_bigtitle {
		margin: 0rpx 0rpx 0rpx 35rpx;
		font-family: Mont;
		font-weight: bold;
		font-size: 60rpx
	}

	.box_top_bigtitle text {
		font-size: 30rpx
	}
	.box_top_smalltitle{
		margin: 12rpx 0rpx 38rpx 35rpx;
		font-family: Mont;
		font-weight: 400;
		font-size: 28rpx;
		color: #4C4C4C;
	}
	.drawal {
		top: 107rpx;
		right: 33rpx;
		position: absolute;
		width: 162rpx;
		height: 50rpx;
		background: #34BA78;
		border-radius: 12rpx;
		font-family: Mont;
		font-weight: bold;
		font-size: 24rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 50rpx;
	}

	.box_top_bottom {
		width: 80%;
		margin: 0rpx auto;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.small_box {
		display: flex;
		flex-direction: column;
		align-items: center;
		font-family: Mont;
		font-weight: 500;
		font-size: 20rpx;
	}

	.small_box text {
		font-size: 32rpx;
	}

	.content {
		padding-top: 42rpx;
		margin: 0rpx auto;
		background: #FFFFFF;
		width: 92%;
		height: 1057rpx;
		background: #FFFFFF;
		border-radius: 19rpx;
		overflow-y: auto;
	}

	.content_top {
		width: 90%;
		margin: 0rpx auto 50rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-family: Mont;
		font-weight: bold;
		font-size: 32rpx;
	}

	.row {
		width: 90%;
		margin: 0rpx auto 33rpx;
		position: relative;
		display: flex;
	}

	.avatar {
		width: 76rpx;
		height: 76rpx;
		border-radius: 50%;
		margin-right: 20rpx;
	}

	.row_right {
		font-family: Mont;
		font-weight: 500;
		font-size: 28rpx;
	}

	.time {
		font-family: Mont;
		font-weight: 500;
		font-size: 24rpx;
		color: #666666;
	}

	.add_num {
		position: absolute;
		top: 50%;
		right: 0;
		transform: translate(0, -50%);
		font-family: Mont;
		font-weight: bold;
		font-size: 24rpx;
	}
</style>